package com.xyh.flowershop.utils;

import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.lang3.RandomUtils;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;

/**
 * @author 小约翰可汗
 * @className OrderNoUtils
 * @createTime 2024/5/1917:02
 * @description 订单号工具类
 */
public class OrderNoUtils {
    public static String generateOrderNo() {
        Date date = new Date();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
        Random random = new Random();
        random.nextInt(999999);
        String randomStr = RandomStringUtils.randomNumeric(6);
        return sdf.format(date) + randomStr;

    }

}
